using System;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.Practices.EnterpriseLibrary.Common;
using Microsoft.Practices.EnterpriseLibrary.Data;

public partial class Controls_Menu_GetMenuTree : System.Web.UI.UserControl
{
    private Database db;

    protected void Page_Load(object sender, EventArgs e)
    {
        db = DatabaseFactory.CreateDatabase(ConfigurationManager.AppSettings["ConnectionStringName"]);

        
        

        loadMenu();
    }

    private void loadMenu()
    {
        DbCommand comMenu = db.GetStoredProcCommand("MenuGet");
        if (SessionHelper<int>.existsVar("UserSecurityLevel"))
            comMenu.Parameters.Add(new SqlParameter("@UserSecurityLevel", SessionHelper<int>.getVar("UserSecurityLevel")));
        else
            comMenu.Parameters.Add(new SqlParameter("@UserSecurityLevel", 0));


    }

    
}
